<template>
  <div>
    <h2>登录</h2>
    <h3>欢迎：{{this.$route.params.uName}}</h3>
    <form action="">
      用户名：<input type="text" v-model="username">
      密码： <input type="password" v-model="password">
      <input type="button" value="denglu" @click="getLogin()">
    </form>
    <router-link to="/register" tag="button">注册</router-link>
  </div>
</template>

<script>
export default {
  name: 'login',
  data () {
    return {
      username: '',
      password: ''
    }
  },
  methods: {
    getLogin () {
      if (this.username === 'admin' && this.password === '123') {
        this.$router.push({
          // path: '/welcome',
          name: 'welcome',
          params: {
            uName: this.username
          }
        })
      }
    }
  }
}
</script>

<style scoped>

</style>
